from spirems import Client, def_msg
import time

cc = Client('/service1', 'std_msgs::String', 'std_msgs::String')
while True:
    req = def_msg('std_msgs::String')
    req['data'] = 'hello service!'
    response = cc.request(req)
    if not response:
        print("TIMEOUT!")
    else:
        print(response['data'])
    time.sleep(1)
